
export const checkPhone = (str) => {
  let targetStr = str.replace(/\s|&nbsp;/g, '')
  if ((/^1(3|4|5|7|8)\d{9}$/.test(targetStr))) {
    return true
  } else {
    return false
  }
}

  //判断是不是邮箱
  export const checkEmail = (str) => {
  let targetStr = str.replace(/\s|&nbsp;/g, '') //先去除用户输入的无效字符
  let reg = /^[a-zA-Z0-9_-]+@([a-zA-Z0-9]+\.)+(com|cn|net|org)$/;
  if (reg.test(targetStr)) {
    return true;
  } else {
    return false;
  }
}